<app>
  <p>today is {format(now, 'date', 'yyyy-mm-dd HH:MM:ss')}</p>
  <p>should display yes: {format(1, 'yesno')}</p>
  <p>should display no: {format(null, 'yesno')}</p>
  <p>should display true: {format(new Date().toString()).date().isToday()}</p>

  <br/>
  <p>in each</p>
  <p>
      <ul>
            <li each="{ item,i in items }">
              { item } as { format(item).number(i) }
            </li>
      </ul>
  </p>

  <script>
  var self = this;

  var items = []
  for(var i=0; i<5; i++){
      items.push(Math.random() * 10)
  }
  self.items = items
  console.log(items)

  this.now = new Date();
  var id = setInterval(function(){
    self.now = new Date();
    self.update();
  });
  self.on('unmount', function(){
    clearInterval(id);
  });
  
  </script>
</app>
